<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'onlineNum.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="./bamcss/bam.css">
	<style type="text/css">
		/* .layer_zhuti a{
			padding: 5px 80px;
			background-color: #696969;
			color: white;
			
		} */
	
	.layer_zhuti iframe{
		height: 95%;
	}
	.layer_zhuti .td1{
			width: 12%;	
	}
	.layer_zhuti .td2{
			width: 16%;	
	}
	</style>
	
	<script type="text/javascript" src="./bamjs/bam.js" charset="gbk"></script>
	<script type="text/javascript" src="./plugin/jqueryqrcode/src/jquery.min.js"></script>
	<script type="text/javascript">
	 $(document).ready(function() {
	 	 $.ajax({
		   type: "get",
		   url: "${pageContext.request.contextPath}/statis/DataCount_ajaxAreaList.action",
		   data: {},
		   dataType:"json",
		   success: function(msg){
			  	var obj = eval("("+msg+")");
			  	var sel = document.getElementById("clarea");
			  	var option  = document.createElement("option");
				for ( var i = 0; i < obj.re.length; i++) {
					sel.options.add(new Option(obj.re[i].areaName,obj.re[i].id));
				}
		    },
	     	error:function(){
	   		alert("系统出错误,请联系技术人员");
		   }
		 });
	 });
	 
	 
	var url = "${pageContext.request.contextPath}/statis/Daliy_dayStatis.action?";
	
	function dataSubmit(){
		url = "${pageContext.request.contextPath}/statis/Daliy_dayStatis.action?";
		//区域
		var objclarea = document.getElementById("clarea"); //定位id
		var indexclarea = objclarea.selectedIndex; // 选中索引
		var areaid = objclarea.options[indexclarea].value; // 选中值
		if(areaid==""||areaid==0){
			areaid=-1;
		}
		//筛选字段
		var zzfidld = "";
		var objfield = document.getElementById("field"); //定位id
		var indexfield = objfield.selectedIndex; // 选中索引
		var valfield = objfield.options[indexfield].value; // 选中值
		if(valfield!=""){
			var numsize = document.getElementById("numsize").value;
			if(numsize==""){
				numsize=-1;
				zzfidld="&"+valfield+"="+numsize;
			}else if(!/^[0-9]*$/.test(numsize)){
				alert("请输入数字");
			}else{
				zzfidld="&"+valfield+"="+numsize;
			}			
		}
		//时间
		var oldDate = document.getElementById("oldDate").value;
		var newDate = document.getElementById("newDate").value;
		//发送
		var urlParam = "odlDateStr="+oldDate+zzfidld+"&areaid="+areaid+"&newDateStr="+newDate+"&" ;
		url = url+urlParam;
		document.getElementById("iframe").src=url;
	}
	</script>
	
  </head>
  
  <body>
   <div class="layer_head">
   			<div class="layer_title">每日统计</div>
   			<div class="layer_seekTime">
   				<div id="div1">
	   				<select style="height: 24px;width: 20%" id="clarea" onchange="dataSubmit()">
	   				</select>
	   				<select style="height: 24px;width: 18%" id="field">
	   					<option value="">全字段</option>
	   					<option value="zzstatic.dayUser">日使用人数</option>
	   					<option value="zzstatic.newUser">日新增用户</option>
	   					<option value="zzstatic.dayNet">日连网次数</option>
	   					<option value="zzstatic.newBinding">日新增绑定</option>
	   				</select>
	   				<span  style="position: relative;color:#696969 ">></span>
		   			<input type="text" id="numsize" value=""/>
		   			<!-- <button>折线图</button>
		   			<button >表格</button> -->
	   			</div>	
   			
	   			<div id="div2">
		   			<input type="date" id="oldDate" name="odlDateStr" value="" 
		   					onFocus="if(value==defaultValue){value='';this.style.color='#000'}" 
		   					onBlur="if(!value){value=defaultValue;this.style.color='#999'}" 
		   					  />
		   				<span  style="position: relative;color:#696969 ">~</span>	
		   			<input type="date" id="newDate" name="newDateStr" value="" 
		   					onFocus="if(value==defaultValue){value='';this.style.color='#000'}" 
		   					onBlur="if(!value){value=defaultValue;this.style.color='#999'}" 
		   					/>
		   			<button onclick="dataSubmit()">搜索</button>
		   		</div>
		</div>	
			<div style="clear: both;"></div>
   		</div>
   		<hr>
   		
   		<div class="layer_zhuti">
   				<table>
   					<tr>
   						<td class="td2">日期</td>
   						<td class="td1">日使用人数</td>
   						<td class="td1">日新增用户</td>
   						<td class="td1">日连网次数</td>
   						<td class="td1">日新增绑定</td>
   						<td class="td1">总用户人数</td>
   						<td class="td1">总绑定人数</td>
   					</tr>
   				</table>
   			<iframe class ="layer_iframe" name="layer_iframe" id ="iframe" src="${pageContext.request.contextPath}/statis/Daliy_dayStatis.action" frameborder=0 ></iframe>
   		</div>
   		
   		<div class="layer_bottom">
			<span class="span1" >**共 <span style="font-size: 14px;color: black;" id="span1"></span> 条数据 / 共
			<span style="font-size: 14px;color: black;" id="span2"></span>&nbsp;页 / 当前第
			<span style="font-size: 14px;color: black;" id="span3"></span>&nbsp;页***</span> 
			
			<span style="float: right;"><input id="tiao"style="width: 50px" type="number" min="1"/><button style="width: 50px" onclick="tiaozhuan()" >go</button></span>
			<button style="margin-right: 40px" onclick="moye()">末 页</button>
			<button style="margin-right: 20px" onclick="xiaye()">下页</button>
			<button style="margin-right: 20px" onclick="shangye()">上 页</button>
			<button style="margin-right: 20px" onclick="shouye()">首页</button>
			<div style="clear: both;"></div>
		</div>
  </body>
</html>
